package com.song.exception.controller;

import com.song.pojo.JobOption;
import com.song.pojo.Result;
import com.song.service.EmpService;
import com.song.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;

    @GetMapping("/empJobData")
    public Result getEepJobData(){
        log.info("获取员工数据统计");
        JobOption jobOption = reportService.getJobOption();
        return Result.success(jobOption);
    }
    @GetMapping("/empJobGender")
    public Result getEmpJobGender(){
        log.info("获取员工性别数据统计");
        List<Map<String,Object>> data = reportService.getEmpJobGender();
        return Result.success(data);
    }
}
